package com.changgou.goods.service.impl;

import com.changgou.goods.dao.SkuMapper;
import com.changgou.goods.pojo.Sku;
import com.changgou.goods.service.SkuService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
import java.util.Map;

@Service
public class SkuServiceImpl implements SkuService {

    @Autowired
    private SkuMapper skuMapper;


    @Override
    public Sku searchById(Integer id) {
        return skuMapper.selectByPrimaryKey(id);
    }

    @Override
    public Integer ByIdUpdate(Sku sku) {

        if (sku==null) {
            return 0 ;
        }

        return skuMapper.updateByPrimaryKeySelective(sku);
    }
}
